package com.zkzx.common.truck.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Objects;

/**
 * 北京中科智兴物联科技有限公司 @版权所有
 *
 * @Author: zhaoyihe@zkraising.com
 * @Date: 2021/05/11/17:04
 * @Description:
 */
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "TailLicenseVO", description = "挂车牌号通用VO")
public class TailLicenseVO implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 省简称
     */
    @ApiModelProperty(value = "省简称", example = "京")
    private String province;

    /**
     * 车牌号码部分
     */
    @ApiModelProperty(value = "号码", example = "A88888")
    private String number;

    /**
     * 完整车牌
     */
    @ApiModelProperty(value = "完整车牌", example = "京A88888")
    private String licence;

    /**
     * 获取车牌号
     * @return 车牌号
     */
    public String getLicence() {
        if (Objects.nonNull(province) && Objects.nonNull(number)) {
            return this.province.concat(this.number);
        }
        return null;
    }
}
